﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Subgurim.Controles;
using Subgurim.Controls;
using Subgurim.Web;

namespace Gmaps2
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            GMap1.addControl(new GControl(GControl.preBuilt.GOverviewMapControl));

            GMap1.addControl(new GControl(GControl.preBuilt.LargeMapControl));

            GLatLng centro = new GLatLng(43, 1);
            GMap1.setCenter(centro,4);

            var pontoespanha = new GLatLng(40.48038142908172, -3.7353515625);
            var pontofranca = new GLatLng(46.227638, 2.213749);
            
            GMarker marker = new GMarker(pontoespanha);
            GMarker marker2 = new GMarker(pontofranca);
            GInfoWindow window = new GInfoWindow(marker, "<center><b>Espanha</b></center>", true);
            GInfoWindow window2 = new GInfoWindow(marker2, "<center><b>França</b></center>", true);
            GMap1.addInfoWindow(window);
            GMap1.addInfoWindow(window2);

            List<GLatLng> pontos = new List<GLatLng>();
            pontos.Add(pontoespanha);
            pontos.Add(centro);
            pontos.Add(pontofranca);
            GPolyline linha = new GPolyline(pontos, "FF0000",2);
            GMap1.addPolyline(linha);

            
            GIcon icone = new GIcon();
            icone.image = "htpp://labs.google.com/ridefinder/images/mm_20red.png";
            icone.shadow = "htpp://labs.google.com/ridefinder/images/mm_20shadow.png";
            icone.iconSize = new GSize(12,20);
            icone.shadowSize = new GSize(22,20);
            icone.iconAnchor = new GPoint(6,20);
            icone.infoWindowAnchor = new GPoint(5,1);

            GMarkerOptions mOptin = new GMarkerOptions();
            mOptin.clickable = false;
            mOptin.icon = icone;


            /*
            GMarker marker4 = new GMarker(goolesucu, mOptin);
            GMarker marker3 = new GMarker(goolesucu2, mOptin);
            GMap1.addGMarker(marker4);
            GMap1.addGMarker(marker3);

            List<GLatLng> pontos = new List<GLatLng>();
            pontos.Add(centro + goolesucu);
            pontos.Add(centro + goolesucu2);
            GPolyline linha = new GPolyline(pontos, "FF0000", 2); 
           GMap1.addPolyline(linha);
             */

            



        }
    }
}